| API Documentation |  |

- MAIN PAGE
- NAMESPACES
- CLASSES

AtmosphereEffect.h
1 // AtmosphereEffect.h
3 //
5
6 namespace nkAstraeus
7 {
25 class AtmosphereEffect final : public Effect
26 {
27 public :
28
29 // Constructor, destructor
34 AtmosphereEffect (System* system) noexcept ;
39 virtual ~AtmosphereEffect () ;
40
41 // Getters
45 nkGraphics::Texture* getSunTransmittanceLut () const ;
49 nkGraphics::Texture* getMultiScatteringLut () const ;
53 nkGraphics::Texture* getSourceColorTexture () const ;
57 nkGraphics::Texture* getSourceDepthTexture () const ;
61 nkGraphics::Shader* getLutShader () const ;
65 nkMaths::Vector getSunPosition () const ;
69 nkMaths::Vector getPlanetAlbedo () const ;
73 nkMaths::Vector getRayleighScattering () const ;
77 nkMaths::Vector getRayleighExtinction () const ;
81 nkMaths::Vector getRayleighAbsorb () const ;
85 nkMaths::Vector getMieScattering () const ;
89 nkMaths::Vector getMieExtinction () const ;
93 nkMaths::Vector getMieAbsorb () const ;
97 nkMaths::Vector getOzoneScattering () const ;
101 nkMaths::Vector getOzoneExtinction () const ;
105 nkMaths::Vector getOzoneAbsorb () const ;
109 float getMieG () const ;
113 float getRayleighHeightDensityFactor () const ;
117 float getMieHeightDensityFactor () const ;
121 float getOzoneHeightDensityFactor () const ;
125 float getDistanceFactor () const ;
129 float getSunIlluminanceFactor () const ;
133 float getSunAngularRadius () const ;
137 unsigned int getSunLutSampleCount () const ;
141 unsigned int getMultiScatteringLutSphereSampleCount () const ;
145 unsigned int getMultiScatteringLutMarchSampleCount () const ;
149 unsigned int getRaymarchSampleCount () const ;
156 unsigned int getSunTransmittanceLutWidth () const ;
163 unsigned int getSunTransmittanceLutHeight () const ;
170 unsigned int getMultiScatteringLutWidth () const ;
177 unsigned int getMultiScatteringLutHeight () const ;
181 SHADOW_MAP_PCF getShadowSamplingMethod () const ;
185 float getShadowDepthBias () const ;
189 bool getShadowDebug () const ;
196 bool getUseHalfFloatForLuts () const ;
200 bool getOnlyScatterOnObjects () const ;
204 bool getDisplaySun () const ;
208 bool getReverseZ () const ;
209
210 // Setters
220 void setSourceColorTexture (nkGraphics::Texture* value) ;
229 void setSourceDepthTexture (nkGraphics::Texture* value) ;
238 void setSunPosition (nkMaths::Vector value) ;
247 void setPlanetAlbedo (nkMaths::Vector value) ;
259 void setRayleighScattering (nkMaths::Vector value) ;
271 void setRayleighExtinction (nkMaths::Vector value) ;
283 void setRayleighAbsorb (nkMaths::Vector value) ;
295 void setMieScattering (nkMaths::Vector value) ;
307 void setMieExtinction (nkMaths::Vector value) ;
319 void setMieAbsorb (nkMaths::Vector value) ;
331 void setOzoneScattering (nkMaths::Vector value) ;
343 void setOzoneExtinction (nkMaths::Vector value) ;
355 void setOzoneAbsorb (nkMaths::Vector value) ;
366 void setMieG (float value) ;
378 void setRayleighHeightDensityFactor (float value) ;
390 void setMieHeightDensityFactor (float value) ;
402 void setOzoneHeightDensityFactor (float value) ;
411 void setDistanceFactor (float value) ;
420 void setSunIlluminanceFactor (float value) ;
428 void setSunAngularRadius (float value) ;
438 void setSunTransmittanceLutSampleCount (unsigned int value) ;
449 void setMultiScatteringLutSphereSampleCount (unsigned int value) ;
459 void setMultiScatteringLutMarchSampleCount (unsigned int value) ;
469 void setRaymarchSampleCount (unsigned int value) ;
481 void setShadowSource (nkGraphics::Texture* shadowMap, nkGraphics::Camera* lightCamera) ;
491 void setShadowSamplingMethod (SHADOW_MAP_PCF value) ;
500 void setShadowDepthBias (float value) ;
509 void setShadowDebug (bool value) ;
518 void setSunTransmittanceLutWidth (unsigned int value) ;
527 void setSunTransmittanceLutHeight (unsigned int value) ;
536 void setMultiScatteringLutWidth (unsigned int value) ;
545 void setMultiScatteringLutHeight (unsigned int value) ;
555 void setUseHalfFloatForLuts (bool value) ;
566 void setOnlyScatterOnObjects (bool value) ;
576 void setDisplaySun (bool value) ;
586 void setReverseZ (bool value) ;
597 void setDebugNumericalInstability (bool value) ;
598
599 // Updates
607 bool refreshLuts () ;
608
609 // Load
610 virtual bool load () override ;
611 virtual void unload () override ;
612
613 public :
614
615 // Statics
626 static nkMemory::UniquePtr<AtmosphereEffect> create (System* system = nullptr) ;
627 } ;
628 }
nkAstraeus::AtmosphereEffect::getMultiScatteringLut
nkGraphics::Texture * getMultiScatteringLut() const
nkAstraeus::AtmosphereEffect::setSourceColorTexture
void setSourceColorTexture(nkGraphics::Texture *value)
nkAstraeus::AtmosphereEffect::getShadowDepthBias
float getShadowDepthBias() const
nkAstraeus::AtmosphereEffect::setShadowSamplingMethod
void setShadowSamplingMethod(SHADOW_MAP_PCF value)
nkAstraeus::AtmosphereEffect::getReverseZ
bool getReverseZ() const
nkAstraeus::AtmosphereEffect::setRayleighAbsorb
void setRayleighAbsorb(nkMaths::Vector value)
nkAstraeus::AtmosphereEffect
An atmosphere effect.
Definition: AtmosphereEffect.h:26
nkAstraeus::AtmosphereEffect::setRayleighExtinction
void setRayleighExtinction(nkMaths::Vector value)
nkAstraeus::AtmosphereEffect::load
virtual bool load() override
nkAstraeus::AtmosphereEffect::setMultiScatteringLutHeight
void setMultiScatteringLutHeight(unsigned int value)
nkAstraeus::AtmosphereEffect::setRayleighScattering
void setRayleighScattering(nkMaths::Vector value)
nkAstraeus::AtmosphereEffect::setDisplaySun
void setDisplaySun(bool value)
nkAstraeus::AtmosphereEffect::getOzoneScattering
nkMaths::Vector getOzoneScattering() const
nkAstraeus::AtmosphereEffect::~AtmosphereEffect
virtual ~AtmosphereEffect()
nkGraphics::Camera
Offers all controls to model a camera.
Definition: Camera.h:14
nkAstraeus::AtmosphereEffect::setMieAbsorb
void setMieAbsorb(nkMaths::Vector value)
nkAstraeus::AtmosphereEffect::getShadowDebug
bool getShadowDebug() const
nkAstraeus::AtmosphereEffect::getSourceColorTexture
nkGraphics::Texture * getSourceColorTexture() const
nkAstraeus::AtmosphereEffect::getMieExtinction
nkMaths::Vector getMieExtinction() const
nkGraphics::Texture
A texture used for rendering, hosted on GPU.
Definition: Texture.h:12
nkAstraeus::AtmosphereEffect::getRayleighExtinction
nkMaths::Vector getRayleighExtinction() const
nkAstraeus::AtmosphereEffect::setReverseZ
void setReverseZ(bool value)
nkAstraeus::AtmosphereEffect::setMieG
void setMieG(float value)
nkAstraeus::AtmosphereEffect::getMultiScatteringLutHeight
unsigned int getMultiScatteringLutHeight() const
nkAstraeus::AtmosphereEffect::getRayleighHeightDensityFactor
float getRayleighHeightDensityFactor() const
nkAstraeus::AtmosphereEffect::getLutShader
nkGraphics::Shader * getLutShader() const
nkAstraeus::AtmosphereEffect::getSunLutSampleCount
unsigned int getSunLutSampleCount() const
nkAstraeus::AtmosphereEffect::setOzoneScattering
void setOzoneScattering(nkMaths::Vector value)
nkAstraeus::AtmosphereEffect::getMieG
float getMieG() const
nkAstraeus::AtmosphereEffect::setRayleighHeightDensityFactor
void setRayleighHeightDensityFactor(float value)
nkAstraeus::AtmosphereEffect::setMultiScatteringLutWidth
void setMultiScatteringLutWidth(unsigned int value)
nkAstraeus::AtmosphereEffect::getRayleighScattering
nkMaths::Vector getRayleighScattering() const
nkAstraeus::AtmosphereEffect::getDistanceFactor
float getDistanceFactor() const
nkAstraeus::System
The main entry point for nkAstraeus engine.
Definition: System.h:15
nkAstraeus::AtmosphereEffect::refreshLuts
bool refreshLuts()
nkAstraeus::AtmosphereEffect::getOnlyScatterOnObjects
bool getOnlyScatterOnObjects() const
nkAstraeus::AtmosphereEffect::setOzoneHeightDensityFactor
void setOzoneHeightDensityFactor(float value)
nkAstraeus::AtmosphereEffect::getSunAngularRadius
float getSunAngularRadius() const
nkAstraeus::AtmosphereEffect::setOzoneExtinction
void setOzoneExtinction(nkMaths::Vector value)
nkGraphics::Shader
A shader class, feeding data to a Program.
Definition: Shader.h:16
nkAstraeus::AtmosphereEffect::getUseHalfFloatForLuts
bool getUseHalfFloatForLuts() const
nkAstraeus::AtmosphereEffect::getSunTransmittanceLutWidth
unsigned int getSunTransmittanceLutWidth() const
nkAstraeus::AtmosphereEffect::getShadowSamplingMethod
SHADOW_MAP_PCF getShadowSamplingMethod() const
nkAstraeus::AtmosphereEffect::setDistanceFactor
void setDistanceFactor(float value)
nkAstraeus::AtmosphereEffect::getMultiScatteringLutWidth
unsigned int getMultiScatteringLutWidth() const
nkAstraeus::AtmosphereEffect::setOnlyScatterOnObjects
void setOnlyScatterOnObjects(bool value)
nkAstraeus::AtmosphereEffect::setPlanetAlbedo
void setPlanetAlbedo(nkMaths::Vector value)
nkAstraeus::AtmosphereEffect::getMultiScatteringLutSphereSampleCount
unsigned int getMultiScatteringLutSphereSampleCount() const
nkAstraeus::AtmosphereEffect::setSunAngularRadius
void setSunAngularRadius(float value)
nkAstraeus::AtmosphereEffect::setSunTransmittanceLutHeight
void setSunTransmittanceLutHeight(unsigned int value)
nkAstraeus::AtmosphereEffect::setUseHalfFloatForLuts
void setUseHalfFloatForLuts(bool value)
nkAstraeus::AtmosphereEffect::getMieAbsorb
nkMaths::Vector getMieAbsorb() const
nkAstraeus::SHADOW_MAP_PCF
SHADOW_MAP_PCF
Percentage Closer Filtering settings available for materials and effects supporting the shadow mappin...
Definition: ShadowMapPcf.h:12
nkAstraeus::AtmosphereEffect::getMultiScatteringLutMarchSampleCount
unsigned int getMultiScatteringLutMarchSampleCount() const
nkAstraeus::AtmosphereEffect::getSourceDepthTexture
nkGraphics::Texture * getSourceDepthTexture() const
nkAstraeus::AtmosphereEffect::getOzoneAbsorb
nkMaths::Vector getOzoneAbsorb() const
nkAstraeus::AtmosphereEffect::setShadowDebug
void setShadowDebug(bool value)
nkAstraeus
Encompasses all API of component NilkinsAstraeus.
Definition: BlurComplexEffect.h:7
nkAstraeus::AtmosphereEffect::getRayleighAbsorb
nkMaths::Vector getRayleighAbsorb() const
nkMemory::UniquePtr
Smart pointer owning the object instance it encapsulates.
Definition: UniquePtr.h:17
nkAstraeus::AtmosphereEffect::setMultiScatteringLutSphereSampleCount
void setMultiScatteringLutSphereSampleCount(unsigned int value)
nkAstraeus::AtmosphereEffect::setSunTransmittanceLutWidth
void setSunTransmittanceLutWidth(unsigned int value)
nkAstraeus::Effect
Base class for all effects in the component.
Definition: Effect.h:16
nkAstraeus::AtmosphereEffect::setShadowSource
void setShadowSource(nkGraphics::Texture *shadowMap, nkGraphics::Camera *lightCamera)
nkAstraeus::AtmosphereEffect::setSunPosition
void setSunPosition(nkMaths::Vector value)
nkAstraeus::AtmosphereEffect::getSunTransmittanceLut
nkGraphics::Texture * getSunTransmittanceLut() const
nkAstraeus::AtmosphereEffect::setMieScattering
void setMieScattering(nkMaths::Vector value)
nkAstraeus::AtmosphereEffect::getSunIlluminanceFactor
float getSunIlluminanceFactor() const
nkAstraeus::AtmosphereEffect::getSunPosition
nkMaths::Vector getSunPosition() const
nkAstraeus::AtmosphereEffect::setRaymarchSampleCount
void setRaymarchSampleCount(unsigned int value)
nkAstraeus::AtmosphereEffect::setDebugNumericalInstability
void setDebugNumericalInstability(bool value)
nkAstraeus::AtmosphereEffect::unload
virtual void unload() override
nkAstraeus::AtmosphereEffect::setMieHeightDensityFactor
void setMieHeightDensityFactor(float value)
nkAstraeus::AtmosphereEffect::setSourceDepthTexture
void setSourceDepthTexture(nkGraphics::Texture *value)
nkAstraeus::AtmosphereEffect::setShadowDepthBias
void setShadowDepthBias(float value)
nkAstraeus::AtmosphereEffect::setOzoneAbsorb
void setOzoneAbsorb(nkMaths::Vector value)
nkAstraeus::AtmosphereEffect::setMieExtinction
void setMieExtinction(nkMaths::Vector value)
nkAstraeus::AtmosphereEffect::setSunTransmittanceLutSampleCount
void setSunTransmittanceLutSampleCount(unsigned int value)
nkAstraeus::AtmosphereEffect::AtmosphereEffect
AtmosphereEffect(System *system) noexcept
nkAstraeus::AtmosphereEffect::getMieHeightDensityFactor
float getMieHeightDensityFactor() const
nkAstraeus::AtmosphereEffect::getRaymarchSampleCount
unsigned int getRaymarchSampleCount() const
nkAstraeus::AtmosphereEffect::setMultiScatteringLutMarchSampleCount
void setMultiScatteringLutMarchSampleCount(unsigned int value)
nkAstraeus::AtmosphereEffect::getOzoneExtinction
nkMaths::Vector getOzoneExtinction() const
nkAstraeus::AtmosphereEffect::getOzoneHeightDensityFactor
float getOzoneHeightDensityFactor() const
nkAstraeus::AtmosphereEffect::getDisplaySun
bool getDisplaySun() const
nkAstraeus::AtmosphereEffect::setSunIlluminanceFactor
void setSunIlluminanceFactor(float value)
nkMaths::Vector
A 4-component vector class, with floats.
Definition: Vector.h:12
nkAstraeus::AtmosphereEffect::getPlanetAlbedo
nkMaths::Vector getPlanetAlbedo() const
nkAstraeus::AtmosphereEffect::getSunTransmittanceLutHeight
unsigned int getSunTransmittanceLutHeight() const
nkAstraeus::AtmosphereEffect::getMieScattering
nkMaths::Vector getMieScattering() const
nkAstraeus::AtmosphereEffect::create
static nkMemory::UniquePtr< AtmosphereEffect > create(System *system=nullptr)